<?php
header("content-type:text/html;charset=utf8");
$password = $_POST["pass"];
$phone=$_POST["phone"];
$con=mysqli_connect('localhost','root','root','test');
mysqli_query($con,"set names utf8");
$res = mysqli_query($con,"select * from vivo where phone=$phone");
$row=mysqli_fetch_assoc($res);
if(!$row){
    $arr = [
        "meta"=>[
            "status"=>0,
            "message"=>"用户名不存在"
        ],
        "data"=>null
    ];
}else{
    
    if($row['password']==$password){
        $arr = [
            "meta"=>[
                "status"=>2,
                "message"=>"登录成功"
            ],
            "data"=>null
        ];
    }else{
        $arr = [
            "meta"=>[
                "status"=>1,
                "message"=>"用户名或者密码不正确"
            ],
            "data"=>null
        ];
    }
}
echo json_encode($arr);